package com.huyna.rsspaper.model;

import java.net.URL;

/*Class model of Article*/
public class Article {
	private String mTitle;			//Title
	private String mDescription;	//Description
	private URL mArticleURL;		//Url of Article
	private String mPubDate;		//Publish date
	private URL mImageURL;			//Url of image
	
	public Article() {
		this.mTitle = "";
		this.mDescription = "";
		this.mArticleURL = null;
		this.mPubDate = "";
		this.mImageURL = null;
	}
	
	public void setTitle(String title){
		this.mTitle = title;
	}
	
	public String getTitle(){
		return this.mTitle;
	}
	
	public void setDescription(String description){
		this.mDescription = description;
	}
	
	public String getDescription(){
		return this.mDescription;
	}
	
	public void setArticleURL(URL articleURL){
		this.mArticleURL = articleURL;
	}
	
	public URL getArticleURL(){
		return mArticleURL;
	}
	
	public void setPubDate(String pubDate){
		this.mPubDate = pubDate;
	}
	
	public String getPubDate(){
		return this.mPubDate;
	}
	
	public void setImageURL(URL imageURL){
		this.mImageURL = imageURL;
	}
	
	public URL getImageURL(){
		return this.mImageURL;
	}
	
	public String toString()
	{
		// limit how much text we display
		if (mTitle.length() > 50)
		{
			return mTitle.substring(0, 50) + "...";
		}
		return mTitle;
	}
}
